package com.levi.enums;

import lombok.Getter;

/**
 * @author shentong
 * @since 2022/3/23 8:22 PM
 */
@Getter
public enum EnumUtil {

    /**
     * 用户分类
     */
    ADMIN(0, "管理员"),
    CUSTOMER(1, "普通用户"),

    /**
     * 通知状态
     */
    ERROR(-1, "服务端错误"),
    SUCCESS(0, "成功"),
    PASSWORD_ERROR(1, "密码错误"),
    USER_EXIST(2, "用户已存在"),
    PARAM_ERROR(3, "参数错误"),
    EMAIL_EXIST(4, "邮箱已被使用"),
    NEED_LOGIN(10, "用户未登录，请先登录"),
    USERNAME_OR_PASSWORD_ERROR(11, "用户名或密码错误"),
    PRODUCT_SOLD_OUT_OR_DELETED(12, "商品已下架或删除"),
    PRODUCT_NOT_EXIST(13, "商品不存在"),
    PRODUCT_STOCK_ERROR(14, "商品库存不足"),
    CART_PRODUCT_NOT_EXIST(15, "购物车中商品不存在"),
    SHIPPING_DELETE_ERROR(16, "收货地址删除失败"),
    SHIPPING_NOT_EXIST(17, "收货地址不存在"),
    CART_SELECTED_IS_EMPTY(18, "请选择商品后下单"),
    ORDER_NOT_EXIST(19, "订单不存在"),
    ORDER_STATUS_ERROR(20, "订单状态有误"),

    STATUS_NOMAL(1, "正常"),
    STATUS_FAIL(0, "废弃"),

    /**
     * 商品状态
     */
    PRODUCT_STATUS_NOMAL(1, "正常"),
    PRODUCT_STATUS_SOLD_OUT(2, "下架"),
    PRODUCT_STATUS_DELETED(3, "删除"),


    /**
     * 订单状态
     */
    ORDER_STATUS_CANCELED(1, "已取消"),
    ORDER_STATUS_NO_PAY(10, "未付款"),
    ORDER_STATUS_PAID(20, "已付款"),
    ORDER_STATUS_SHIPPED(40, "已发货"),
    ORDER_STATUS_TRADE_SUCCESS(50, "交易成功"),
    ORDER_STATUS_CLOSE(60,"交易关闭"),

    /**
     * 支付方式
     */
    PAY_TYPE_ON_LINE(1, "在线支付"),
    ;

    public final Integer code;
    public final String msg;

    EnumUtil(Integer code, String msg) {
        this.msg = msg;
        this.code = code;
    }


}
